package com.suli.multimedia.mapper;

import com.baomidou.mybatisplus.core.injector.methods.DeleteBatchByIds;
import com.suli.multimedia.entity.Article;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.suli.multimedia.entity.vo.ArticleVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author SuLi
 * @since 2022-03-17
 */
@Mapper
public interface ArticleMapper extends BaseMapper<Article> {
    //根据文章类型获取文章总数
    Integer getArticleCount(@Param("articleType") Integer articleType);
    //根据文章类型分页获取文章列表
    List<Article> getArticleIsDeleted(@Param("articleType") Integer articleType,
                                      @Param("page") Integer page,
                                      @Param("limit") Integer  limit);
    //通过文章id获取文章
     ArticleVO getArticleDetail(@Param("articleId") Integer articleId);
     //删除文章
    Integer deleteByArticleId(@Param("articleId") Integer articleId);
    //删除文章内容
    Integer deleteContentByArticleId(@Param("articleId") Integer articleId);
    //批量删除文章
    void DeleteBatchByIds(List<Integer> articleIds);
    void DeleteContentBatchByIds(List<Integer> articleIds);

    //批量还原文章
    int recoveryArticles(List<Integer>  list);
    //批量还原文章内容
    int recoveryContent(List<Integer>  list);
}
